<template>
  <dt-modal-edit ref='modal' title='修改状态' :label-width='100' :width='450' @ok='onOk' :loading='loading'>
  </dt-modal-edit>
</template>

<script>
  import Opt from '../opt/UpdateOpt.js'
  import buildMgr from '@/biz/buildingManagement/basicInfo/index.js'
  
  export default {
    data() {
      return {
        info: {},
        change: null,
        loading: false
      }
    },
    methods: {
      show(info, change) {
        this.info = info
        this.change = change
        this.$refs.modal.show(new Opt(), this.info)
      },
      hide() {
        this.$refs.modal.hide()
      },
      onOk() {
        this.loading = true
        buildMgr.housesEdit({
          housesId: this.info.housesId,
          settlementStatus: this.info.settlementStatus
        }).then((res) => {
          this.$Message.success('财务状态修改成功')
          this.loading = false
          this.change()
          this.hide()
        }).catch(err => {
          this.loading = false
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
</style>
